import Vue from "vue";
import VueRouter from "vue-router";
import Container from "./views/Container.vue";
import Login from "./views/Login";
import StudentCourseSelect from "./views/student/StudentCourseSelect";
import StudentCourse from "./views/student/StudentCourse";
import StudentInfo from "./views/student/StudentInfo";
import StudentTimeTable from "./views/student/StudentTimeTable";
import StudentExam from "./views/student/StudentExam";
import StudentScore from "./views/student/StudentScore";
import TeacherCourse from "./views/teacher/TeacherCourse";
import TeacherTimetable from "./views/teacher/TeacherTimetable";
import TeacherGrade from "./views/teacher/TeacherGrade";
import TeacherCourseManage from "./views/teacher/TeacherCourseManage.vue";
import TeacherCourseDetail from "./views/teacher/TeacherCourseDetail.vue"
import AdminDepartment from "./views/admin/AdminDepartment";
import AdminMajor from "./views/admin/AdminMajor";
import AdminClass from "./views/admin/AdminClass";
import AdminStudent from "./views/admin/AdminStudent";
import AdminTeacher from "./views/admin/AdminTeacher";
import AdminCourse from "./views/admin/AdminCourse";
import AdminStudentCourse from "./views/admin/AdminStudentCourse";
import AdminAdmin from "./views/admin/AdminAdmin";
import Home from "./views/Home";
import CourseDetail from './views/student/CourseDetail.vue';
import Discussion from './views/student/Discussion.vue';
import DiscussionDetail from './views/student/DiscussionDetail.vue';
import Homework from "./views/student/Homework.vue";
import TeacherHomework from "./views/teacher/TeacherHomework.vue";
import HomeworkDetail from "./views/teacher/HomeworkDetail.vue";
import TeacherDiscussion from "./views/teacher/TeacherDiscussion.vue";
import TeacherTestpaper from "./views/teacher/TeacherTestpaper.vue";
import TestpaperTable from "./views/teacher/TestpaperTable.vue";
import ExamRoomSetup from "./views/teacher/ExamRoomSetup.vue";
import MutualEvaluation from "./views/student/MutualEvaluation.vue";

Vue.use(VueRouter);

const routes = [
  {
    path: "/",
    name: "container",
    component: Container,
    children: [
      {
        path: "/student",
        name: "student-home",
        component: Home
      },
      {
        path: '/mutual-evaluation/:homeworkId',
        name: 'MutualEvaluation',
        component: MutualEvaluation,
      },
      
      {
        path: "/student/course/select",
        name: "student-course-select",
        component: StudentCourseSelect
      },
      {
        path: "/student/course",
        name: "student-course",
        component: StudentCourse
      },
      {
        path: "/student/timetable",
        name: "student-timetable",
        component: StudentTimeTable
      },
      {
        path: "/student/exam",
        name: "student-exam",
        component: StudentExam
      },
      {
        path: "/student/score",
        name: "student-score",
        component: StudentScore
      },
      {
        path: "/student/info",
        name: "student-info",
        component: StudentInfo
      },
      {
        path: '/course/:courseId',  // 路由参数 :courseId
        name: 'CourseDetail',
        component: CourseDetail
      },
      
      {
        path: "/teacher",
        name: "teacher-home",
        component: Home
      },
      {
        path: "/teacher/course",
        name: "teacher-course",
        component: TeacherCourse
      },
      {
        path: "/teacher/timetable",
        name: "teacher-timetable",
        component: TeacherTimetable
      },
      {
        path: "/teacher/grade",
        name: "teacher-grade",
        component: TeacherGrade
      },
      {
        path:"/teacher/courseManage",
        name:"teacher-course-manage",
        component:TeacherCourseManage
      },
      {
        path:"/courseManage/:courseId",
        name:"course-manage",
        component:TeacherCourseDetail
      },
      {
        path: "/admin",
        name: "admin-home",
        component: Home
      },
      {
        path: "/admin/department",
        name: "admin-department",
        component: AdminDepartment
      },
      {
        path: "/admin/major",
        name: "admin-major",
        component: AdminMajor
      },
      {
        path: "/admin/class",
        name: "admin-class",
        component: AdminClass
      },
      {
        path: "/admin/student",
        name: "admin-student",
        component: AdminStudent
      },
      {
        path: "/admin/teacher",
        name: "admin-teacher",
        component: AdminTeacher
      },
      {
        path: "/admin/course",
        name: "admin-course",
        component: AdminCourse
      },
      {
        path: "/admin/student/course",
        name: "admin-student-course",
        component: AdminStudentCourse
      },
      {
        path: "/admin/admin",
        name: "admin-admin",
        component: AdminAdmin
      },
      {
        path: "/discussion/:courseId", // 设置讨论区的路由，courseId 为参数
        name: "Discussion", // 路由名称
        component: Discussion, // 讨论区组件
      },
      {
        path: "/discussion/:discussionId",
        name: "DiscussionDetail",
        component: DiscussionDetail,
      },
      {
        path: "/course/homework/:courseId", // 设置讨论区的路由，courseId 为参数
        name: "Homework", // 路由名称
        component: Homework, // 讨论区组件
      },
      {
        path: "/courseManage/homework/:courseId", // 设置讨论区的路由，courseId 为参数
        name: "teacher-Homework", // 路由名称
        component: TeacherHomework, // 讨论区组件
      },
      {
        path: "/courseManage/homework/homeworkdetail/:homeworkId", // 设置讨论区的路由，homeworkId 为参数
        name: "HomeworkDetail", // 路由名称
        component: HomeworkDetail, // 讨论区组件
      },
      {
        path: "/teacher/discussion/:courseId",
        name: 'teacher-discussion',
        component: TeacherDiscussion,
        
      },
      {
        path: "/teacher/testpaperpost/:courseId",// 设置路由，courseId 为参数test
        name: 'teacher-testpaperpost',// 路由名称
        component: TeacherTestpaper,// 组件
        
      },
      {
        path: "/teacher/testpapertable/:courseId",// 设置路由，courseId 为参数
        name: 'teacher-testpapertable',// 路由名称
        component: TestpaperTable,// 组件
        
      },
      {
        path: '/exam-room-setup/:courseId',
        name: 'exam-room-setup',
        component: () => import('@/views/teacher/ExamRoomSetup.vue')  // 引入 ExamRoomSetup 组件
      },
      

    ]
  },
  {
    path: "/login",
    name: "login",
    component: Login
  }
];

const router = new VueRouter({
  mode: "history",
  base: process.env.BASE_URL,
  routes
});

export default router;
